package com.zzb.dao.impl;

import com.zzb.dao.NavigationDao;
import com.zzb.entity.NavigationEntity;
import com.zzb.util.MyBatisUtils;

import java.util.List;

public class NavigationDaoImpl implements NavigationDao {
    @Override
    public NavigationEntity findByName(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.findByName(navigationEntity);
    }

    @Override
    public int add(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.add(navigationEntity);
    }

    @Override
    public int delete(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.delete(navigationEntity);
    }

    @Override
    public NavigationEntity findById(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.findById(navigationEntity);
    }

    @Override
    public List<NavigationEntity> findAll(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.findAll(navigationEntity);
    }

    @Override
    public int update(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.update(navigationEntity);
    }

    @Override
    public int count(NavigationEntity navigationEntity) {
        NavigationDao navigationDao = MyBatisUtils.getMapper(NavigationDao.class);
        return navigationDao.count(navigationEntity);
    }
}
